<?php
$this->pageTitle = 'Manage State';
$this->breadcrumbs = array(
    $model->label(2) => array('index'),
    Yii::t('app', 'Manage'),
);

$this->menu = array(
    //array('label'=>Yii::t('app', 'List') . ' ' . $model->label(2), 'url'=>array('index')),
    array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create')),
);
?>
<script type="text/javascript">
    function ChangeStatus(id, is_active)
    { 	
        $.ajax({
            url: "<?php echo $statuschangeurl; ?>",   
            type: "post", 
            data: "id=" + id + "&is_active=" + is_active, 
            dataType:"html",
		
            success: function(msg){
                $('#state-grid').yiiGridView.update('state-grid');
               
            }
        }); 
  
    } 
</script>

<h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'state-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns' => array(
        //'id',
        'name',
        array(
            'name' => 'country_id',
            'type' => 'raw',
            'value' => '$data->country->name',
            'filter' =>false,
        ),
        array(
            'name' => 'is_active',
            'type' => 'raw',
            'value' => 'changeIsActiveIngridView($data)',
            'filter' => array('0' => Yii::t('app', 'Inactive'), '1' => Yii::t('app', 'Active')),),
        array(
            'class' => 'CButtonColumn',
        ),
    ),
));
?>